﻿using UnityEngine;
using UnityEditor;

using System;
using Hont;

public class GameDateTime_Test2 : MonoBehaviour
{
    [ContextMenu("CompareTest1")]
    public void AddMonthTest1()
    {
        var dateTime1 = new GameDateTime();
        var dateTime2 = dateTime1.AddMonths(4);

        Debug.Log("dateTime2 > dateTime1 ? " + (dateTime2 > dateTime1));
    }

    [ContextMenu("CompareTest2")]
    public void CompareTest2()
    {
        var dateTime1 = new GameDateTime(1, 1, 1);
        var dateTime2 = new GameDateTime(1, 1, 1);

        Debug.Log("dateTime2 == dateTime1 ? " + (dateTime2 == dateTime1));
        Debug.Log("dateTime2 != dateTime1 ? " + (dateTime2 != dateTime1));
    }

    [ContextMenu("CompareTest3")]
    public void CompareTest3()
    {
        var dateTime = new GameDateTime();
        dateTime = dateTime.AddMonths(-1);

        PrintGameDate(dateTime);

        var dateTime2 = new DateTime();
        dateTime2 = dateTime2.AddMonths(-1);

        PrintDate(dateTime2);
    }

    [ContextMenu("CompareTest4")]
    public void CompareTest4()
    {
        var dateTime = new GameDateTime();
        dateTime = dateTime.AddMonths(8);
        dateTime = dateTime.AddDays(2);

        PrintGameDate(dateTime);

        var dateTime2 = new DateTime();
        dateTime2 = dateTime2.AddMonths(8);
        dateTime2 = dateTime2.AddDays(2);

        PrintDate(dateTime2);
    }

    [ContextMenu("CompareTest5")]
    public void CompareTest5()
    {
        var dateTime = new GameDateTime();
        dateTime = dateTime.AddMonths(7);
        dateTime = dateTime.AddMonths(1);

        PrintGameDate(dateTime);

        var dateTime2 = new DateTime();
        dateTime2 = dateTime2.AddMonths(7);
        dateTime2 = dateTime2.AddMonths(1);

        PrintDate(dateTime2);
    }

    [ContextMenu("CompareTest6")]
    public void CompareTest6()
    {
        var dateTime = new GameDateTime(1, 1, 1);
        Debug.Log("dateTime [day of week1]: " + dateTime.DayOfWeek);

        dateTime = new GameDateTime(1, 1, 7);
        Debug.Log("dateTime [day of week2]: " + dateTime.DayOfWeek);

        dateTime = new GameDateTime(1, 1, 5);
        Debug.Log("dateTime [day of week3]: " + dateTime.DayOfWeek);

        var dateTime2 = new DateTime(1, 1, 1);
        Debug.Log("dateTime2 [day of week1]: " + (int)dateTime2.DayOfWeek);

        dateTime2 = new DateTime(1, 1, 7);
        Debug.Log("dateTime2 [day of week2]: " + (int)dateTime2.DayOfWeek);

        dateTime = new GameDateTime(1, 1, 5);
        Debug.Log("dateTime [day of week3]: " + dateTime.DayOfWeek);
    }

    [ContextMenu("CompareTest7")]
    public void CompareTest7()
    {
        var dateTime = new GameDateTime(235, 3, 30);
        Debug.Log("dateTime [Month1]: " + dateTime.Month);

        dateTime = new GameDateTime(235, 3, 31);
        Debug.Log("dateTime [Month2]: " + dateTime.Month);

        dateTime = new GameDateTime(235, 4, 30);
        Debug.Log("dateTime [Month3]: " + dateTime.Month);

        var dateTime2 = new DateTime(235, 3, 30);
        Debug.Log("dateTime2 [Month1]: " + dateTime2.Month);

        dateTime2 = new DateTime(235, 3, 31);
        Debug.Log("dateTime2 [Month2]: " + dateTime2.Month);

        dateTime2 = new DateTime(235, 4, 30);
        Debug.Log("dateTime2 [Month3]: " + dateTime2.Month);
    }

    void PrintGameDate(GameDateTime dateTime)
    {
        Debug.Log("Game --- "
            + " Year: "
            + dateTime.Year
            + " Month: "
            + dateTime.Month
            + " Day: "
            + dateTime.Day
            + " Hour: "
            + dateTime.Hour
            + " Minute: "
            + dateTime.Minute
            + " Second: "
            + dateTime.Second);
    }

    void PrintDate(DateTime dateTime)
    {
        Debug.Log("Game --- "
            + " Year: " + dateTime.Year
            + " Month: "
            + dateTime.Month
            + " Day: "
            + dateTime.Day
            + " Hour: "
            + dateTime.Hour
            + " Minute: "
            + dateTime.Minute
            + " Second: "
            + dateTime.Second);
    }
}
